#include <iostream>
using namespace std;
class Solution {
public:
    bool isPalindrome(string s) {
        string::iterator left = s.begin();
        string::iterator right = s.end();
        while (left < right) {
            while (!isalnum(*left) && left < right) {
                left++;
            }
            while (!isalnum(*right) && left < right) {
                right--;
            }
            if (tolower(*left) != tolower(*right)) {
                printf("\"");
                cout << s;
                printf("\" 不是回文串");
                return false;
            }
            ++left, --right;
        }
        printf("\"");
        cout << s;
        printf("\" 是回文串");
        return true;
    }
};
int main() {
    Solution a;
    string s("0P");
    cout << a.isPalindrome(s);

    return 0;
}


